#pragma once
#include <vector>

using namespace std;

namespace removeDuplicates
{
	class Solution {
	public:
		int removeDuplicates(vector<int>& nums) 
		{
			int size = nums.size();
			if (size == 0)
			{
				return 0;
			}
			int left = 0;
			for (int right = 1; right < size; right++)
			{
				if (nums[left] != nums[right])
				{
					left++;
					if (left != right)
					{
						nums[left] = nums[right];
					}
				}
			}

			return left+1;
		}
	};
}